//
//  Evaluate.m
//  OrgOnline
//
//  Created by kiko on 16/3/3.
//  Copyright © 2016年 kiko. All rights reserved.
//
#import "OrangeTwenineLabel.h"
#import "GrayLine.h"
#import "SixTwoLabel.h"
#import "TextOnlyButton.h"
#import "Evaluate.h"


@interface Evaluate (){
    NSString *evaluteScore;
    NSArray *evaluteSumList;
    NSArray *evaluteContentList;
}

@end

@implementation Evaluate

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"查看评价";
    self.view.backgroundColor=[UIColor whiteColor];
    [self viewDidLoadBlue];
    //[self configHeadRight];
    [self configContent];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)configContent{
    
    evaluteSumList=@[@"0",@"0",@"0",@"0"];
    GrayLine *line1=[[GrayLine alloc] initWithFrame:CGRectMake(0, 196, swidth, 0.5)];
    [self.view addSubview:line1];
    
    GrayLine *line2=[[GrayLine alloc] initWithFrame:CGRectMake(0, 236, swidth, 0.5)];
    [self.view addSubview:line2];
    
    
    if(evaluteScore==nil){//如果没有评价
        OrangeTwenineLabel *score=[[OrangeTwenineLabel alloc] initWithFrame:CGRectMake(0, 96.5, swidth, 40)];
        score.text=@"5.0";
        score.textAlignment=NSTextAlignmentCenter;
        [self.view addSubview:score];
        
        UIImageView *starimg1=[[UIImageView alloc] initWithFrame:CGRectMake((swidth-40)/2, 146.5,7, 7)];
        starimg1.image=[UIImage imageNamed:@"mestar"];
        [self.view addSubview:starimg1];
        
        UIImageView *starimg2=[[UIImageView alloc] initWithFrame:CGRectMake((swidth-40)/2+8, 146.5,7, 7)];
        starimg2.image=[UIImage imageNamed:@"mestar"];
        [self.view addSubview:starimg2];
        
        UIImageView *starimg3=[[UIImageView alloc] initWithFrame:CGRectMake((swidth-40)/2+16, 146.5,7, 7)];
        starimg3.image=[UIImage imageNamed:@"mestar"];
        [self.view addSubview:starimg3];
        
        UIImageView *starimg4=[[UIImageView alloc] initWithFrame:CGRectMake((swidth-40)/2+24, 146.5,7, 7)];
        starimg4.image=[UIImage imageNamed:@"mestar"];
        [self.view addSubview:starimg4];
        
        UIImageView *starimg5=[[UIImageView alloc] initWithFrame:CGRectMake((swidth-40)/2+32, 146.5,7, 7)];
        starimg5.image=[UIImage imageNamed:@"mestar"];
        [self.view addSubview:starimg5];
        
    }
    else{
    //casha.text=[[NSString alloc] initWithFormat:@"¥ %@ " ,[totalIncomes objectAtIndex:1]];
        
        OrangeTwenineLabel *score=[[OrangeTwenineLabel alloc] initWithFrame:CGRectMake(0, 96.5, swidth, 40)];
        score.text=evaluteScore;
        score.textAlignment=NSTextAlignmentCenter;
        [self.view addSubview:score];
    
    }
    
    
    TextOnlyButton *but1=[[TextOnlyButton alloc] initWithFrame:CGRectMake((swidth-240)/8, 207.5, 60, 20)];
    but1.textlabel.text=[[NSString alloc] initWithFormat:@"全部(%@) " ,[evaluteSumList objectAtIndex:0]];
    but1.tag=1;
    [but1 addTarget:self action:@selector(evaluteDetails) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:but1];
    
    TextOnlyButton *but2=[[TextOnlyButton alloc] initWithFrame:CGRectMake(3*(swidth-240)/8+60, 207.5, 60, 20)];
    but2.textlabel.text=[[NSString alloc] initWithFormat:@"好评(%@) " ,[evaluteSumList objectAtIndex:0]];
    but2.tag=2;
    [self.view addSubview:but2];
    
    TextOnlyButton *but3=[[TextOnlyButton alloc] initWithFrame:CGRectMake(5*(swidth-240)/8+120, 207.5, 60, 20)];
    but3.textlabel.text=[[NSString alloc] initWithFormat:@"中评(%@) " ,[evaluteSumList objectAtIndex:0]];
    but3.tag=3;
    [self.view addSubview:but3];
    
    TextOnlyButton *but4=[[TextOnlyButton alloc] initWithFrame:CGRectMake(7*(swidth-240)/8+180, 207.5, 60, 20)];
    but4.textlabel.text=[[NSString alloc] initWithFormat:@"差评(%@) " ,[evaluteSumList objectAtIndex:0]];
    but4.tag=4;
    [self.view addSubview:but4];
    
    
    
    
    

}
-(void)evaluteDetails{
    //根据选中的tag改变table中的内容，而不是替换成不同的table

}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
